<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------
namespace addon\mall\logic;
use app\common\logic\LogicBase;
use \tpfcore\Core;

class OrderAction extends LogicBase
{
	public function getOrderAction($data=[]){
		return self::getList($data);
	}
	public function saveOrderAction($data){
		$validate=Core::addonValidate($this->name);
        $validate_result = $validate->scene("add")->check($data);
        if (!$validate_result) {
            return [RESULT_ERROR, $validate->getError(), null];
        }
        $result = self::saveObject($data);
		if($result){
			return [RESULT_SUCCESS,"操作成功",url('mall/OrderAction/index')];
		}
		return [RESULT_ERROR,"操作失败"]; 
	}
	public function delOrderAction($data){
		$result = self::deleteObject($data,true);
		if($result){
			return [RESULT_SUCCESS,"操作成功",url('mall/OrderAction/index')];
		}
		return [RESULT_ERROR,"操作失败"]; 
	}	
}